{{--商城前台首页--}}
    <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>优生活购物</title>
    <link rel="stylesheet" type="text/css" href="{{asset('org/home/css')}}/index.css">
    @stack('css')
    <script src="{{asset('org/home/js')}}/jquery-1.11.3.min.js"></script>
    <script src="{{asset('org/home/js')}}/index.js"></script>

    <script type="text/javascript" src="{{asset('org/home/js')}}/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="{{asset('org/home/js')}}/jquery.SuperSlide.2.1.1.source.js"></script>
    {{--@include('layouts._hdjs')--}}
    <script src="https://cdn.bootcss.com/sweetalert/2.1.2/sweetalert.min.js"></script>
    @stack('js')
</head>
<body>
@include('layouts._homeMessage')
<!--侧边-->
<div class="jdm-toolbar-wrap J-wrap">
    <div class="jdm-toolbar J-toolbar">
        <div class="jdm-toolbar-panels J-panel"></div>
        <div class="jdm-toolbar-tabs J-tab">
            <div data-type="bar" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-ger">
                <i class="tab-ico"></i>
                <em class="tab-text"><a href="{{route('home.center')}}" style="color: white">个人中心</a></em>
            </div>
            <div data-type="bar" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-cart">
                <i class="tab-ico"></i>
                <em class="tab-text"><a href="{{route('home.cart.index')}}" style="color: white">购物车</a></em>
            </div>
            <div data-type="bar" clstag="h|keycount|cebianlan_h_follow|btn" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-follow" data-name="follow" data-login="true">
                <i class="tab-ico"></i>
                <em class="tab-text"><a href="{{route('home.collect.myCollect')}}" style="color: white">我的收藏</a></em>
            </div>
        </div>
    </div>
    <div class="jdm-toolbar-footer">
        <div data-type="link" id="#top" class="J-trigger jdm-toolbar-tab jdm-tbar-tab-top">
            <a href="#" clstag="h|keycount|cebianlan_h|top">
                <i class="tab-ico"></i>
                <em class="tab-text">顶部</em>
            </a>
        </div>
    </div>
    <div class="jdm-toolbar-mini"></div>
    <div id="J-toolbar-load-hook" clstag="h|keycount|cebianlan_h|load"></div>
</div>

<!--头部-->
<div id="header">
    <div class="header-box">
        <h3 class="huany">优生活购物商城欢迎您的到来！</h3>
        <ul class="header-right">
            @if(!auth()->user())
                <li class="denglu">Hi~<a class="red"  href="{{route('home.login')}}">请登录!</a> <a    href="{{route('home.register')}}">[免费注册]</a></li>
            @else
                <li class="denglu">Hi~<a class="red" title="点击查看个人中心" target="_blank" href="{{route('home.center')}}">【{{auth()->user()->name}}】</a> <a   href="{{route('home.logout')}}">【退出】</a></li>
            @endif
            <li class="shu"></li>
            <li class="denglu"><a class="ing_ps" href="{{route('home.collect.myCollect')}}">我的收藏</a></li>
        </ul>
    </div>
</div>
<!--搜索栏-->
<div class="toub_beij">
    <div class="logo"><a href="/"><img src="{{asset('org/home/images')}}/logo.jpg" style="width: 250px;margin-top: -35px"></a></div>

       <div class="search">
         <input type="text" name="search"  class="text" id="textt">
         <button class="button" onclick="sou()">搜索</button>
       </div>

    <div class="right">
        <i class="gw-left"></i>
        <i class="gw-right"></i>
        <div class="sc">
            <i class="gw-count">{{isset($carts)?count($carts):0}}</i>
            <i class="sd"></i>
        </div>
        <a href="{{route('home.cart.index')}}">我的购物车</a>
        <div class="dorpdown-layer">

            <div class="smt"><h4 class="fl">最新加入的商品</h4></div>
            <ul>
                @if(count($carts))
                    @foreach($carts as $v=>$cart)
                        @if($v<2)
                <li class="meiyou">
                    <div class="gouwc_tup">
                        <a href="{{route('home.cart.index')}}"><img src="{{$cart->goods->picture[0]}}"></a>
                    </div>
                    <div class="gouwc_biaot">
                        <a href="{{route('home.cart.index')}}"  style="font-size: 12px;line-height: 15px">{{$cart->goods->title}}</a>
                    </div>
                    <div class="gouwc_shanc">
                        <span>￥{{$cart->goods->price}}</span>
                        <a  href="{{route('home.cart.destory',$cart)}}" style="font-size: 12px;line-height: 15px">删除</a>
                    </div>
                </li>
                        @endif
                    @endforeach
                        <div class="smt"><a href="{{route('home.cart.index')}}" style="font-size: 14px;line-height: 15px">查看更多商品</a></div>
                @elseif(count($carts)==0)
                    <li>
                    <img src="{{asset('org/home/images')}}/settleup-nogoods.png">
                    <span>购物车中还没有商品，赶紧选购吧！</span>
                    </li>
                @endif
            </ul>
            {{--<ul>--}}
                {{--@if(count($carts))--}}
             {{--@foreach($carts as $cart)--}}
                {{--<li class="meiyou">--}}
                        {{--<span>购物车中有{{count(auth()->id()->cart)}}件商品</span>--}}
                    {{--<span>购物车中共有<span style="color: red;">{{count($carts)}}</span>件商品,点击<a href="{{route('home.cart.index')}}" style="color: red;">立即查看</a>。</span>--}}
      {{--<a href="{{route('home.cart.index')}}" style="font-size: 12px;color: red;margin-left: 0px;">{{$cart->goods->title}}</a>--}}
                {{--</li>--}}
              {{--@endforeach--}}
                {{--@endforeach--}}
                {{--@elseif(count($carts)==0)--}}
                    {{--<li>--}}
                        {{--<img src="{{asset('org/home/images')}}/settleup-nogoods.png">--}}
                        {{--<span>购物车中还没有商品，赶紧选购吧！</span>--}}
                    {{--</li>--}}
                {{--@endif--}}
            {{--</ul>--}}
        </div>
    </div>
    <div class="hotwords">
        <a class="biaoti">热门搜索：</a>
        @foreach($hotWords as $hotWord)
        <a href="{{route('home.search.goods',$hotWord['hotwords'])}}">{{$hotWord['hotwords']}}</a>
            @endforeach
    </div>
</div>

<script>
    function sou() {
        let hotWord = $('#textt').val();
        location.href = '/search/'+ hotWord;
    }
</script>

@yield('content')

<div class="dib_beij">
    <div class="dib_jvz_beij">
        <div class="shangp_baoz">
            <p>本地购物&nbsp;&nbsp;看得见的商品</p>
            <p class="beng1">正品行货&nbsp;&nbsp;购物无忧</p>
            <p class="beng++++2">低价实惠&nbsp;&nbsp;帮你省钱</p>
            <p class="beng3">本地直发&nbsp;&nbsp;专业配送</p>
        </div>
        <div class="zhongj_youx">
            <div class="lieb_daoh">
                <div class="kef_dianh">
                    <p>客服电话</p><span>18335460350</span>
                </div>
            </div>
            <div class="lieb_daoh">
                <div class="kef_dianh kef_dianh_youx">
                    <p>意见收集邮箱</p><p>1130224187@qq.com</p>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
